import Layout from '@/layout'

// 常量路由/静态路由
export const constantRoutes = [
  {
    path: '/Login',
    component: () => import('@/views/Login/index'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [{
      path: 'home',
      name: 'home',
      component: () => import('@/views/Home/index'),
      meta: { title: '首页', icon: 'el-icon-s-home' }
    }]
  }
]

// 动态路由/异步路由
export const allRoutesAsync = [
  // 权限管理
  {
    path: '/acl',
    component: Layout,
    redirect: '/acl/user',
    name: 'Acl',
    meta: { title: '权限管理', icon: 'el-icon-goods' },
    children: [
      {
        path: 'user',
        name: 'User',
        component: () => import('@/views/acl/User/index'),
        meta: { title: '用户管理', icon: 'el-icon-s-custom' }
      },
      {
        path: 'role',
        name: 'Role',
        component: () => import('@/views/acl/Role/index'),
        meta: { title: '角色管理', icon: 'el-icon-user' }
      },
      {
        name: 'RoleAuth',
        path: '/acl/role/auth',
        component: () => import('@/views/acl/Role/RoleAuth'),
        meta: {
          title: '角色管理',
          activeMenu: '/acl/role'
        },
        hidden: true
      },
      {
        path: 'permission',
        name: 'Permission',
        component: () => import('@/views/acl/Permission/index'),
        meta: { title: '菜单管理', icon: 'el-icon-s-operation' }
      }
    ]
  },
  // 商品管理
  {
    path: '/product',
    name: 'Product',
    component: Layout,
    redirect: '/product/trademark',
    meta: { title: '商品管理', icon: 'el-icon-goods' },
    children: [
      {
        path: 'trademark',
        name: 'Trademark',
        component: () => import('@/views/product/Trademark/index'),
        meta: { title: '品牌管理', icon: 'table' }
      },
      {
        path: 'attr',
        name: 'Attr',
        component: () => import('@/views/product/Attr/index'),
        meta: { title: '平台属性管理', icon: 'tree' }
      }
    ]
  }
]

// 任意路由
export const anyRoute = {
  path: '*',
  redirect: '/404',
  hidden: true
}
